import type { GreasyForkElements } from '../../../../../../../../types/constants/personalization/greasy_fork'
import { ThemeVarService } from '../../../../../../../../lib/abstract/style/theme_var/service'
import {
  PAGE_ELEMENTS,
  SUPPORTED_PLATFORMS,
} from '../../../../../../../../types/constants'

export class BianDetailPage {
  elements: GreasyForkElements = PAGE_ELEMENTS[SUPPORTED_PLATFORMS.BIAN]
  private static instance: BianDetailPage
  private readonly themeVarService: ThemeVarService = ThemeVarService.getInstance()

  /**
   * 获取单例实例
   */
  public static getInstance(): BianDetailPage {
    if (!BianDetailPage.instance) {
      BianDetailPage.instance = new BianDetailPage()
    }
    return BianDetailPage.instance
  }

  init(): void {}

  getMainStyles(): string {
    return `
.wrap {
  #main {
    .photo {
      .view {
        border: none !important;
        
        p {
          a {
            color: var(${this.themeVarService.link.default.text});
            
            &:hover {
              color: var(${this.themeVarService.link.default.textHover});
            }
          }
        }
        
        .photo-txt {
          b {
            color: var(${this.themeVarService.em.text});
          }
        }
      }
    }
  }
}
`
  }
}
